#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    int i = 0, count = 0;
    for (i = 1; i <= 2019; i++)
    {
        int j = i;
        while (j)
        {
            if (j % 10 == 9)
            {
                count++;
                break;
            }
            j /= 10;
        }
    }
    printf("%d\n", count);
    return 0;
}
